<!--{template control/admin/tpl/admin_header}-->
<div class="page_title">
    <h1>{$action_arr[$type][1]}{$_lang['manage']}</h1>
    <div class="tool">
        <a href="index.php?do=trans&view=rights&type={$type}">{$action_arr[$type][1]}{$_lang['list']}</a>
		<a href="javascript:void(0);" class="here">{$action_arr[$type][1]}{$_lang['manage']}</a>
    </div>
</div>
 <div class="box post">
  <div class="tabcon">
   <div class="title"><h2>{$trans_object[$report_info[obj]]}{$action_arr[$type][1]}#{$report_id}</h2></div>
    <div class="detail">
     <form action="index.php?do={$do}&view={$view}&type={$type}&report_id={$report_id}" method="post" name="frm" id="frm">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
   
	   
	   <tr>
       <th scope="row" width="130">{$action_arr[$type][1]}{$_lang['the_promoters']}</th>
       <td>
       		<a href="{$_K[siteurl]}/index.php?do=space&member_id={$report_info[uid]}" target="_blank">$report_info['username']</a>
			<font color="red">E-mail</font>:{$user_info['email']}&nbsp;||&nbsp;<font color="red">{$_lang['tel']}</font>:{$user_info['phone']}&nbsp;||&nbsp;<font color="red">QQ</font>:{$user_info['qq']}&nbsp;||&nbsp;<font color="red">{$_lang['mobile']}</font>:{$user_info[mobile]}
	   </td>
      </tr>
	  <tr>
       <th scope="row" width="130">{$action_arr[$type][1]}{$_lang['object']}</th>
       <td>
       		<a href="{$_K[siteurl]}/index.php?do=space&member_id={$report_info[to_uid]}" target="_blank">$report_info['to_username']</a>
			<font color="red">E-mail</font>:{$to_userinfo['email']}&nbsp;||&nbsp;<font color="red">{$_lang['tel']}</font>:{$to_userinfo['phone']}&nbsp;||&nbsp;<font color="red">QQ</font>:{$to_userinfo['qq']}&nbsp;||&nbsp;<font color="red">{$_lang['mobile']}</font>:{$to_userinfo[mobile]}
	   </td>
      </tr>
	  <tr>
         <th scope="row" width="130">{$_lang['apply']}{$action_arr[$type][1]}{$_lang['time']}</th>
         <td><!--{date('Y-m-d H:i:s',$report_info[on_time])}--></td>
      </tr>
	  <tr>
        <th scope="row" width="130">{$_lang['apply_status']}</th>
        <td>{$trans_status[$report_info[report_status]]}</td>
      </tr>
	 <tr>
        <th scope="row" width="130">{$action_arr[$type][1]}{$_lang['explain']}</th>
        <td><!--{eval echo nl2br($report_info['report_desc'])}--></td>
     </tr>
	 <tr>
        <th scope="row" width="130">{$action_arr[$type][1]}{$_lang['attachment']}</th>
        <td>
			<!--{eval $filename=substr($report_info[report_file],strrpos($report_info[report_file],'/')+1);}-->
			{if $report_info[report_file]}<a href="index.php?do={$do}&view={$type}&ac=download&filename=$filename&filepath={$v[report_file]}">{$filename}</a>{else}{$_lang['no_submit_attachment']}{/if}
		</td>
    </tr>
	<tr>
         <th scope="row" width="130">{$_lang['belong_to_task']}</th>
         <td>
         	<a href="{$_K[siteurl]}/index.php?do=task&task_id={$obj_info[origin_id]}" target="_blank">{$obj_info[origin_title]}</a>
		 {$_lang['task_cost']}{$_lang['zh_mh']} {$obj_info[cash]}  
		  {$trans_object[$report_info[obj]]}{$_lang['id']}#{$report_info['obj_id']}
		 </td>
       </tr>
	<tr>
       <th scope="row" width="130">{$action_arr[$type][1]}{$_lang['process_scheme']}</th>
	   <td>
	   	{if $report_info['report_status'] != 4}
	 
			{if $process_can['cancel_bid']}
				<input type="checkbox" name="op_result[reset_task]" id="reset_task" value="1">
				{$_lang['reset_task_status_is_in']}
				,{$_lang['task_delay_day']}:<input type="text" name="op_result[delay_days]" id="delay_days"
				 onblur="clearstr(this)" size="4" maxlength="1" class="txt" >
				 <br>
			<input type="checkbox" name="op_result[cancel_bid]" id="cancel_bid" value="1">
			{$_lang['cancel_bid']}
			<font color="red">{$_lang['cancel_bid_to_not_bid']}</font> 
			{/if}
			{if $process_can['deduct']}
				<br>{$_lang['be_report_people_surplus']}{$credit_info[type]}:{$credit_info[max_credit]}{$_lang['point']}
				       {$_lang['deduction_be_report_people']}{$credit_info[$type][1]}{$credit_info[type]}		
				<input type="text" name="op_result[credit_value]" id="credit" size=4 class="txt"
				 onblur="clearstr(this)"
				 max="{$credit_info[max_credit]}">{$_lang['point']}{$_lang['zh_jh']} <span>{$_lang['suggest_deduction_point_not_more']}{$credit_info[max_credit]}</span>(<font color="red">{$_lang['do_not_choose_if_not_deducted']}</font>)
			{/if}
			{if $process_can['freeze_user']}
				<br>
				<input type="checkbox" name="op_result[freeze_user]" id="freeze_user" value="1">
				{$_lang['freeze_user']}
				<input type="text" name="op_result[freeze_day]" id="freeze_day" onblur="clearstr(this)" maxlength="2" size=4 class="txt">{$_lang['day']}{$_lang['zh_jh']}(<font color="red">{$_lang['do_not_choose_if_not_freeze']}</font>)
			{/if}
		{else}
		  {$report_info[op_result]}
		   
		{/if}
		
	   </td>
	</tr>
	<tr>
      <th scope="row">&nbsp;</th>
      <td>
          <div class="clearfix padt10">
             {if $report_info['report_status'] != 4}
			 <input type="hidden" name="op_result[result]" id="result">		
          	 <input type="hidden" name="op_result[action]" id="action">
			 <label for="reply" id="lab_replay" style="display:none;" >{$_lang['please_explain_reason']}{$_lang['zh_mh']}<br>
			 <textarea cols="25"  rows="7"  style="width:360px;" name="op_result[reply]" id="reply" onclick="this.value=''">{$_lang['please_input_untenable_reason']}</textarea>
			 </label> 
          	 <button class="positive primary pill button" type="submit" name="btn_report" id="btn_report" value="{$_lang['process']}{$action_arr[$type][1]}" onclick="return report();"><span class="icon pen"></span>{$_lang['process']}{$action_arr[$type][1]}</button>
			 <button class="positive primary pill button" type="submit" name="btn_report" value="{$action_arr[$type][1]}{$_lang['untenable']}" onclick="return check();"><span class="icon cross "></span>{$action_arr[$type][1]}{$_lang['untenable']}</button>
			 {else}
         	 <button class="pill button" type="button" onclick="to_back();" value="{$_lang['return']}"><span class="uparrow icon"></span>{$_lang['return']}</button>
			 {/if}
          </div>
      </td>
   </tr>
 </table>
 </form>
 </div>     
</div>     
</div>
<script type="text/javascript">
	function report(){
		var reportType='{$type}';//交易维权类型 rights 维权    report举报
		switch(reportType){
			case "rights":
				var obj_cash=parseFloat($obj_info[cash])+0.00;
				var wk_get  =parseFloat($("#wk_get").val())+0.00;
				var gz_get  =parseFloat($("#gz_get").val())+0.00;
				
				if(wk_get<0.00||gz_get<0.00){
					art.dialog.alert("{$_lang['commission_not_support_negative']}");return false;
				}else if(wk_get+gz_get!=obj_cash){
					art.dialog.alert("{$_lang['input_please_confirm']}{$action_arr[$type][1]}{$_lang['commission_distribution_equal']}"+obj_cash);return false;
				}
				var content="{$_lang['employer_distribution']}{$_lang['zh_mh']}"+gz_get+"{$_lang['yuan']}，{$_lang['witkey_distribution']}{$_lang['zh_mh']}"+wk_get+"{$_lang['yuan']}{$_lang['zh_jh']}";
				art.dialog({
   						title: "{$_lang['confirm_report']}",
  				 		content: "{$_lang['your_current_process_scheme_is']}{$_lang['zh_mh']}<br>"+content,
   						icon: 'question',
   						yesFn: function(){
							$("#result").val(content);
							$("#action").val('pass');
							$("#frm").submit()
						},
					    noFn :function(){this.close();return false;}
					});
				return false;
				break;
			case "report":
		    	var credit=parseInt($("#credit").val())+0;
				var maxCredit=parseInt($("#credit").attr("max"))+0;
				var freeze_day=parseInt($("#freeze_day").val())+0;
				var delay_days = Math.abs(parseInt($("#delay_days").val())+0);
				if(isNaN(credit)&&!$("#reset_task").is(":checked")&&!$("#cancel_bid").is(":checked")&&!$("#freeze_user").is(":checked")){
					art.dialog.alert("{$_lang['warning_not_choose_process_scheme']}");return false;
				}
				if($("#reset_task").is(":checked") && isNaN(delay_days)){
					art.dialog.alert("{$_lang['please_input_delay_day']}");return false;
				}
				if($("#credit").val()){
					if(isNaN(credit)){
						art.dialog.alert("{$_lang['warning_fill_in_deduction_point']}");return false;
					}else if(credit<0){
						art.dialog.alert("{$_lang['waring_deduction_point_not_negative']}");return false;
					}
					else if(credit==0||credit>maxCredit){
						art.dialog.alert("{$_lang['waring_deduction']}{$credit_info[type]}{$_lang['max_is']}:"+maxCredit+"{$_lang['point']}");return false;
					}
				}
				 
				if($("#freeze_user").is(":checked")){
					if(isNaN(freeze_day)||freeze_day==0){
						art.dialog.alert("{$_lang['waring_fill_in_freeze_day']}");return false;
					}		
				}
				var content='';
				if($("#reset_task").is(":checked")){
					content += "{$_lang['reset_task_status_is_in']},{$_lang['task_delay']}"+delay_days+"{$_lang['day']}<br>";
				}
				if($("#cancel_bid").is(":checked")){
					content+="{$_lang['cancel_user']}{$report_info[to_username]}{$_lang['of_bid_status']},";
				}
				if(credit){
					content+="{$_lang['deduction']}{$report_info[to_username]}{$credit_info[type]}"+credit+"{$_lang['point']}{$_lang['zh_jh']}<br>";
				}
				if($("#freeze_user").is(":checked")){
					content+="{$_lang['freeze_user']}{$report_info[to_username]}"+freeze_day+"{$_lang['day']}{$_lang['zh_jh']}";
				}
				art.dialog({
   						title: "{$_lang['confirm_report']}",
  				 		content: "{$_lang['your_current_process_scheme_is']}{$_lang['zh_mh']}<br>"+content,
   						icon: 'question',
   						yesFn: function(){
							$("#result").val(content);
							$("#action").val('pass');$("#frm").submit()},
					    noFn :function(){this.close();return false;}
					});
				return false;
				break;
		}
	}
	function check(){
		art.dialog({
   			title: "{$_lang['confirm_not_process']}{$action_arr[$type][1]}{$_lang['record']}?",
 			content:document.getElementById('lab_replay'),
			follow: document.getElementById('btn_report'),
			icon: 'question',
   			yesFn: function(){
				var i = document.getElementById('reply').value;
				if(!i){
					art.dialog.alert("{$_lang['not_process_reason_not_null']}");
					return false;
				}
				$("#result").val("{$action_arr[$type][1]}{$_lang['untenable']}:"+document.getElementById('reply').value);
				$("#action").val('no_pass');$("#frm").submit()},
			noFn :function(){this.close();return false;}
		});
	 
		return false;
	}
</script>
<!--{template control/admin/tpl/admin_footer}-->